using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_DepartmentMap : EntityTypeConfiguration<t_Department>
    {
        public t_DepartmentMap()
        {
            // Primary Key
            this.HasKey(t => t.FItemID);

            // Properties
            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBrNO)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FPhone)
                .HasMaxLength(30);

            this.Property(t => t.FFax)
                .HasMaxLength(30);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FNumber)
                .HasMaxLength(255);

            this.Property(t => t.FName)
                .HasMaxLength(80);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(80);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_Department");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FBrNO).HasColumnName("FBrNO");
            this.Property(t => t.FManager).HasColumnName("FManager");
            this.Property(t => t.FPhone).HasColumnName("FPhone");
            this.Property(t => t.FFax).HasColumnName("FFax");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FDProperty).HasColumnName("FDProperty");
            this.Property(t => t.FDStock).HasColumnName("FDStock");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FAcctID).HasColumnName("FAcctID");
            this.Property(t => t.FCostAccountType).HasColumnName("FCostAccountType");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FCalID).HasColumnName("FCalID");
            this.Property(t => t.FPlanArea).HasColumnName("FPlanArea");
            this.Property(t => t.FOtherARAcctID).HasColumnName("FOtherARAcctID");
            this.Property(t => t.FOtherAPAcctID).HasColumnName("FOtherAPAcctID");
            this.Property(t => t.FPreARAcctID).HasColumnName("FPreARAcctID");
            this.Property(t => t.FPreAPAcctID).HasColumnName("FPreAPAcctID");
            this.Property(t => t.FIsCreditMgr).HasColumnName("FIsCreditMgr");
        }
    }
}
